<div class="page-container edit-container">
	<div class="loading-body" *ngIf="isPosting">
		<mdl-spinner *ngIf="isPosting" single-color active></mdl-spinner>
	</div>
	<div class="edit-header">
		<a routerLink="/user" mdl-ripple mdl-button>
			<i class="material-icons">keyboard_backspace</i> 返回
		</a>
		<mdl-layout-title>{{ IsEdit ? '编辑' : '添加' }}人员</mdl-layout-title>
		<div class="space"></div>
	</div>

	<div class="inside-wrap mdl-grid">
		<div class="edit-container mdl-cell mdl-cell--6-col">
			<p class="block-title">位置信息</p>
			<!-- <mdl-layout-title>{{ IsEdit ? '编辑' : '添加' }}人员</mdl-layout-title> -->
			<!-- <mdl-select #selectedCompany label="选择公司" floating-label [autocomplete]="true">
				<mdl-option *ngFor="let opt of companyConfig | filterCompany:searchQuery" [value]="opt.value">{{opt.key}}</mdl-option>
			</mdl-select> -->

			<dynamic-form #userForm (getPlayLoad)="onLoadFormData($event)" [ctrls]="formControls">
			</dynamic-form>

			<button mdl-ripple mdl-button mdl-button-type="raised" [disabled]="!userForm.form.valid || isFormPosting || !company" (click)="save(userForm)"
			 mdl-colored="primary">
				<i class="material-icons">done</i>保存
			</button>

		</div>
		<div class="company-info mdl-cell mdl-cell--6-col">
			<p class="block-title">公司信息</p>
			<div class="demo-card-event mdl-card mdl-shadow--2dp">
				<div class="mdl-card__title mdl-card--expand">
					<h4>
						{{company ? company[0]?.name : ''}}
					</h4>
					<p>{{staff?.userName}}</p>
					<p>{{staff?.email}}</p>
					<p>{{staff?.phone}}</p>
				</div>
				<div class="mdl-card__actions mdl-card--border user-card" *ngIf="company">
					<div>
						<span class="company-desc">
							<i class="material-icons">place</i> {{Location.building + '-' + Location.floor + '-' + Location.unit }}</span>
					</div>
				</div>
			</div>
		</div>
	</div>

	<location-select *ngIf="!IsUserProperty && !IsUserHr" [showTable]="showTable" [(Data)]="locationProperties" [static]="true"
	 [(Company)]="company"></location-select>
	<!-- <h1>{{company ? company[0]?.name : ''}}</h1> -->
</div>